{% set pypi_name = 'python-ironic-inspector-client' %}
{% set upstream_version = upstream_version('4.4.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Python client and CLI tool for Ironic Inspector
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('python-openstackclient') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('osc-lib') }}
BuildRequires:  {{ py3('oslo.concurrency') }}
BuildRequires:  {{ py3('reno') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('testrepository') }}
BuildArch:      noarch

%description
Ironic Inspector is an auxiliary service for discovering hardware properties
for a node managed by OpenStack Ironic. Hardware introspection or hardware
properties discovery is a process of getting hardware parameters required for
scheduling from a bare metal node, given its power management credentials
(e.g. IPMI address, user name and password).

This package contains Python client and command line tool for Ironic Inspector.

%package -n python3-ironic-inspector-client
Summary: Python client and CLI tool for Ironic Inspector
Requires:       {{ py3('PyYAML') }}
Requires:       {{ py3('keystoneauth1') }}
Requires:       {{ py3('python-openstackclient') }}
Requires:       {{ py3('osc-lib') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('requests') }}

%description -n python3-ironic-inspector-client
Ironic Inspector is an auxiliary service for discovering hardware properties
for a node managed by OpenStack Ironic. Hardware introspection or hardware
properties discovery is a process of getting hardware parameters required for
scheduling from a bare metal node, given its power management credentials
(e.g. IPMI address, user name and password).

This package contains Python client and command line tool for Ironic Inspector.

This package contains the Python 3.x module.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
sed -i -e 's,hacking.*,,' test-requirements.txt
sed -i -e 's,coverage.*,,' test-requirements.txt
sed -i -e 's,doc8.*,,' test-requirements.txt
%py_req_cleanup

%build
%py3_build

%install
%py3_install

%check
%{python_expand rm -rf .testrepository
python3 -m unittest discover ironic_inspector_client
}

%files -n python3-ironic-inspector-client
%doc README.rst
%license LICENSE
%{python3_sitelib}/ironic_inspector_client
%{python3_sitelib}/*.egg-info

%changelog
